<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../../resources/common/page/sessionovertime.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>角色管理</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
    <script type="text/javascript" src="role.js"></script>
    <script type="text/javascript" src="authorizationMenu.js"></script>
    <script type="text/javascript" src="<%=basePath%>resources/common/dataGridCellTip.js"></script>
    <script type="text/javascript" src="<%=basePath%>resources/common/viewHistory.js"></script>
  </head>
  <body class="easyui-layout">
  	<div id="toolbar" style="height:auto;">
  		<table  style="line-height:80px;">
		  	<tr align="left">
		  		<td width="100" align="right">角色名称:</td>
		  		<td width="100" align="left"><input class="easyui-textbox" value="" id="rolesName" data-options="prompt:'模糊查询'"/></td>
		  	</tr>
		</table>
		<div style="margin-left: -2px;margin-right: -2px;" class="toolbuttonbg">
	        <a href="javaScript:openDialog_add();" name="role_add" style="float:left;" class="easyui-linkbutton" iconCls="icon-add" plain="true">添加</a>
	        <div class="datagrid-btn-separator"></div>
	        <a href="javaScript:openDialog_edit();" name="role_editor" style="float:left;" class="easyui-linkbutton" iconCls="icon-edit" plain="true">编辑</a>
	        <div class="datagrid-btn-separator"></div>
	        <a href="javaScript:delRole();" name="role_delete" style="float:left;" class="easyui-linkbutton" iconCls="icon-cancel" plain="true">删除</a>
	        <div class="datagrid-btn-separator"></div>
	        <a href="javaScript:viewHistory('sys_roles', 'rolesId');" name="role_viewhistory" style="float:left;" class="easyui-linkbutton" iconCls="icon-viewsdetail" plain="true">操作日志</a>
	        <div class="datagrid-btn-separator"></div>
	        <a href="javaScript:openMenuAuthorization();" name="role_menu_competence" style="float:left;" class="easyui-linkbutton" iconCls="icon-chart-organisation" plain="true">菜单权限</a>
	        <div class="datagrid-btn-separator"></div>
	        <a href="javaScript:setPortal();" name="role_portal_competence" style="float:left;" class="easyui-linkbutton" iconCls="icon-sys_portal" plain="true">面板权限</a>
	        <div class="datagrid-btn-separator"></div>
	        <a href="javaScript:reloadRole();" name="role_refresh" style="float:left;" class="easyui-linkbutton" iconCls="icon-reload" plain="true">刷新</a>
	        <div class="datagrid-btn-separator"></div>
	        <a href="javascript:queryRole()" name="role_query" class="easyui-linkbutton" iconCls="icon-search" plain="true">查询</a>
	    </div>
	</div>  
    <!-- 表格 -->
    <table id="dataGridTable" fit="true"  pagination="true" rownumbers="true" toolbar="#toolbar" 
        singleSelect="true" fitColumns="false" striped="true" url="sys/findRole.action"></table> 
	
	<!-- 编辑/新增角色-->
	<div id="roleInfoDialog" iconCls="icon-save" style="width:400px;height:200px;">
		<div class="easyui-layout" fit="true">
		  	<div region="center" border="false" style="padding-top:40px;padding-left:20px;">
		    	<table class="fullTable">
		        	<tr>
		          		<td class="tr">角色名称：</td>
		          		<td>
		          		<input type="text" size="40" class="easyui-textbox" id="roleInfoDialog_roleName" maxlength="40" data-options="required:true,missingMessage:'该输入项为必输项'">
		          		<input type="hidden" id="roleInfoDialog_roleId">
		        	</tr>
		  		</table>
		    </div>
	 	</div>
	 </div>
	 <!-- 授权面板-->
	<div id="setPortalDialog" iconCls="icon-save" style="width:500px;height:350px;">
		<div class="easyui-layout" fit="true">
		  	<div region="center" border="false" class="uims-dialog">
	        	<input type="hidden" name="oldData" id="oldData"/>
	        	<input type="hidden" name="roleId" id="save_role_Id"/>
		    	<table class="fullTable" align="center" id="setPortalTable" style="margin-left: 30px;">
		  		</table>
		    </div>
	 	</div>
	 </div>
	 <!-- 授权菜单 -->
	<div id="menuAuthorizationDiv" class="easyui-layout" iconCls="icon-menu" style="padding: 5px; width: 800px; height: 500px;">
	  	<div region="center" border="false">
	    	<div style="margin-left: -2px;margin-right: -2px;background-color:#C6E2FF;"> 
		        <a href="javaScript:saveAuthorizationMenu();" class="easyui-linkbutton" iconCls="icon-save" plain="true">保存菜单</a>
		    </div>
	    	<ul id="authorizationMenuTree" style="padding:10px;height:auto;"></ul>
	    </div>
	    <div region="east" border="false" style="background: #fff; border: 1px solid #ccc;width:500px;">
	    	<div id="toolbar2" style="margin-left: -2px;margin-right: -2px;background-color:#C6E2FF;">
		  		<a href="javaScript:saveAuthResource();" class="easyui-linkbutton" iconCls="icon-save" plain="true">保存资源</a>
			</div>  
			<table id="dataGridTableMenu" class="easyui-datagrid" fit="true" rownumbers="true" 
		        toolbar="#toolbar2" singleSelect="false" fitColumns="true" striped="true">  
			    <thead> 
			        <tr>
			            <th checkbox="true" field="checked" width="60"></th>
			            <th field="resourceName" width="70">资源名称</th> 
			            <th field="resourceUrl" width="80">资源URL</th>  
			            <th field="resourceText" width="100">资源描述</th> 
			        </tr>
			    </thead>  
			</table>
	    </div>
	 </div>
	<%@ include file="../../resources/common/page/viewHistory.jsp"%>
  </body>
</html>
<%@ include file="../../resources/common/page/button.jsp"%>